<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Object.property</title>
</head>
<body>
    <!-- 
        复习Object.defineProperty
            作用：给指定对象，添加指定属性，且可以“高级定制”
    -->
    <script>
        const object1 = {a:1};
        const object2 = {b:2};


        Object.defineProperty(object1, 'b', {
            // 通过value添加的属性是可以枚举的
            value: 42,
            writable: false,


        });

        object1.b = 77;
        console.log(object1);
        console.log(object1.b);
          

    </script>

</body>
</html>
